package com.study.minio.controller;

import com.study.minio.utils.MinIoUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 文件访问接口
 * @author Mayjean
 * @date 2020/10/21
 */
@Slf4j
@RestController
@Validated
@RequestMapping("/file/")
public class FileController {

    private MinIoUtils minIoUtils = new MinIoUtils();

    /**
     * 获取图片
     */
    @GetMapping("getBucketPolicy")
    public String getBucketPolicy(@PathVariable(name = "backetName") String backetName) {
        return minIoUtils.getBucketPolicy(backetName);
    }
}